<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
</head>
<body>
<div id="app">
   <base-layout>
       <p slot="header">
            <span>title1</span>
            <span>title2</span>
       </p>
       <p>主要内容1</p>
       <p>主要内容2</p>
       <p slot="footer">底部信息</p>
   </base-layout>
    <hr>

    <base-layout>
       <template slot="header">
           <p>title1</p>
           <p>title2</p>
       </template>
        <p>主要内容1</p>
        <p>主要内容2</p>
        <template slot="footer">
            <p>footer1</p>
            <p>footer2</p>
        </template>
    </base-layout>
</div>

<script type="text/javascript">

    Vue.component('base-layout', {
        template: `
            <div>
                <header>
                <slot name="header"></slot>
                </header>
                <main>
                    <slot></slot>
                </main>
                <footer>
                    <slot name="footer"></slot>
                </footer>
            </div>
        `
    })
    var app = new Vue({
        el: '#app'
    })

</script>

</body>
</html>